﻿using AgencyManagerSystem.Model;
using System.Collections.Generic;
using System.Linq;
namespace AgencyManagerSystem.DataFetcher
{
    public class CustBalFetcher : ErpFetcher<CustomerBalModel>
    {
        public CustBalFetcher() : base()
        {
             
        }
        public CustomerBalModel GetBal(string customer)
        {
            Condition[] conditions = new Condition[] {
                new Condition() { Key = "CUSTCODE", Op = "=", Value = customer }
            };
            var list = List(conditions);
            if (list.Count > 0)
            {
                return list.First();
            }
            else
                return null;
        }
    }
}
